ENH: array_namespace: support torch.compile#413
Merged
Conversation
lucascolley
commented
Apr 3, 2026
lucascolley
commented
Apr 3, 2026
f52391f to
b2b0911
Compare
Co-authored-by: Evgeni Burovski <evgeny.burovskiy@gmail.com>
b2b0911 to
053a0bc
Compare
lucascolley
commented
Apr 3, 2026
Member
|
Interesting! Any chance you checked if vendoring this version in SciPy works? |
Member
Author
|
No, but you can see it working in CI at data-apis/array-api-extra#668. |
ev-br
approved these changes
Apr 3, 2026
Member
ev-br
left a comment
There was a problem hiding this comment.
Looks good!
I ran scipy tests with this branch locally. On a CUDA enabled machine, there are some failures, but they all seem unrelated:
FAILED scipy/sparse/linalg/_isolve/tests/test_iterative.py::test_precond_dummy[rand-cmplx-sym-pd-F-cg-numpy-batch_b0-batch_A0] - AssertionError:
FAILED scipy/stats/tests/test_device_dtype.py::test_hypothesis_tests[torch-float32-ttest_1samp] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_hypothesis_tests[torch-float32-ttest_rel] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_hypothesis_tests[torch-float32-ttest_ind] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_hypothesis_tests[torch-float32-pearsonr] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_hypothesis_tests[torch-float64-ttest_1samp] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_hypothesis_tests[torch-float64-ttest_rel] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_hypothesis_tests[torch-float64-ttest_ind] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_hypothesis_tests[torch-float64-pearsonr] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_combine_pvalues[torch-float32-tippett] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_combine_pvalues[torch-float32-mudholkar_george] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_combine_pvalues[torch-float64-tippett] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
FAILED scipy/stats/tests/test_device_dtype.py::test_combine_pvalues[torch-float64-mudholkar_george] - TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
Here's a PR to your branch with a test, #414
I think we should merge in a test, then merge this PR.
Member
|
Merged, thanks Lucas! |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes gh-411